<?php
/**
 * Created by PhpStorm.
 * User: sunyu
 * Date: 2017/7/20
 * Time: 下午3:23
 */


//http://sportsipad.qq.com/init/config

class CollectApi {

    public static function collectHome(){

//            $conn = file_get_contents("http://www.jianshu.com/");//获取页面内容
//
//            error_log($conn);
//
////            $pattern="/<li><a title=\"(.*)\" target=\"_blank\" href=\"(.*)\">/iUs";//正则
////
////            preg_match_all($pattern, $conn, $arr);//匹配内容到arr数组
////
////            //print_r($arr);die;
////
////            foreach ($arr[1] as $key => $value) {//二维数组[2]对应id和[1]刚好一样,利用起key
////                $url="http://www.93moli.com/".$arr[2][$key];
//////                $sql="insert into list(title,url) value ('$value', '$url')";
//////                mysql_query($sql);
////
////                error_log("<a href='content.php?url=http://www.93moli.com/$url'>$value</a>"."<br/>");
////            }
////            $id++;
////            error_log("正在采集URL数据列表$id...请稍后...");
////            error_log("<script>window.location='list.php?id=$id'</script>");
//
//
        error_log("定时采集任务");




        // header('Content-type: text/json;charset=utf-8');
        $url = "http://gw.api.taobao.com/router/rest/taobao.tbk.item.get?q='女装'";
        $re=file_get_contents($url);
        print_r($re);
        error_log($re);

    }






}